package com.dem.android.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ListSourseAdapter extends ArrayAdapter<String> {
	private String[] objects;
	// private Activity context;
	private LayoutInflater vi;

	// private ImageLoaderNew im;

	public ListSourseAdapter(Context context, int textViewResourceId, String[] objects) {
		super(context, textViewResourceId, objects);
		this.objects = objects;
		// im = new ImageLoaderNew(context);
		// this.context = (Activity) context;
		vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		// return super.getView(position, convertView, parent);

		View v = convertView;
		if (v == null) {
			v = vi.inflate(android.R.layout.simple_list_item_1, null);
		}
		TextView textView = (TextView) v.findViewById(android.R.id.text1);

		textView.setText(objects[position]);
		// im.displayImage(objects.get(position).getUrlDetail(), context,
		// imageView);
		// tt.setText(items[position].getValue());

		return v;
	}

}
